package com.easemob.skin;

import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.easemob.chatuidemo.R;


/**
 * 皮肤设置界面
 *
 * @author xiaohua Deng
 * @date 2014-9-28
 */
public class SkinActivity extends BaseActivity implements OnClickListener {

    private SkinSettingManager mSettingManager;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.myskin);
        mSettingManager = new SkinSettingManager(this);
        mSettingManager.initSkins();

        findViewById(R.id.imageView1).setOnClickListener(this);
        findViewById(R.id.imageView2).setOnClickListener(this);
        findViewById(R.id.imageView3).setOnClickListener(this);
        findViewById(R.id.imageView4).setOnClickListener(this);
        findViewById(R.id.imageView5).setOnClickListener(this);
        findViewById(R.id.imageView6).setOnClickListener(this);


    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.imageView1:
                mSettingManager.toggleSkins(0);



                break;
            case R.id.imageView2:
                mSettingManager.toggleSkins(1);

                break;
            case R.id.imageView3:
                mSettingManager.toggleSkins(2);

                break;
            case R.id.imageView4:
                mSettingManager.toggleSkins(3);

                break;
            case R.id.imageView5:
                mSettingManager.toggleSkins(4);


                break;
            case R.id.imageView6:
                mSettingManager.toggleSkins(5);


                break;

        }
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
            finish();
            return false;
        }
        return false;
    }

}
